
package xyz.zq.cloud.bs.api.feign.factory;


import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import xyz.zq.cloud.bs.api.feign.RemoteLogService;
import xyz.zq.cloud.bs.api.feign.fallback.RemoteLogServiceFallbackImpl;

/**
 * 远程日志服务回退工厂
 */
@Component
public class RemoteLogServiceFallbackFactory implements FallbackFactory<RemoteLogService> {

    @Override
    public RemoteLogService create(Throwable throwable) {
        RemoteLogServiceFallbackImpl remoteLogServiceFallback = new RemoteLogServiceFallbackImpl();
        remoteLogServiceFallback.setCause(throwable);
        return remoteLogServiceFallback;
    }
}
